package edu.zhang.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import edu.zhang.dao.TypeDAO;
import edu.zhang.po.Type;

@WebServlet("/MenuTypeList")
public class MenuTypeList extends HttpServlet {
	private static final long serialVersionUID = 1L;
    
	private TypeDAO typeDAO = new TypeDAO();
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		List<Type> list = typeDAO.getAllType();
		HttpSession session = request.getSession();
		session.setAttribute("list", list);
		
		request.getRequestDispatcher("/Back/menu/addMenu.jsp").forward(request, response);
	}
}
